//
//  ServicerCell.m
//  reSearchDemo
//
//  Created by 云库 on 15/7/22.
//  Copyright (c) 2015年 Kiwaro. All rights reserved.
//

#import "ServicerCell.h"

@implementation ServicerCell

- (void)awakeFromNib {
   
}

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _userHeaderImg=[[UIImageView alloc]init];
        [self addSubview:_userHeaderImg];
        _userName=[[UILabel alloc]init];
        [self addSubview:_userName];
        _yunNum=[[UILabel alloc]init];
        [self addSubview:_yunNum];
        _area=[[UILabel alloc]init];
        [self addSubview:_area];
        _address=[[UILabel alloc]init];
        [self addSubview:_address];
        _phoneNum=[[UILabel alloc]init];
        [self addSubview:_phoneNum];
        _distance=[[UILabel alloc]init];
        [self addSubview:_distance];
    }
    return self;
}
-(void)setUser:(User *)user{
    _user=user;
    _userHeaderImg.frame=CGRectMake(5, 20, self.frame.size.height-40, self.frame.size.height-40);
    _userHeaderImg.backgroundColor=[UIColor redColor];
    
    _userName.frame=CGRectMake(_userHeaderImg.frame.size.width+5+15, 10, 40, 20);
    _userName.text=@"张三";
    _userName.font=[UIFont systemFontOfSize:14];
    
    _yunNum.frame=CGRectMake(_userName.frame.size.width+_userName.frame.origin.x+30, 10, 150, 20);
    _yunNum.text=@"云库号：2514555";
    _yunNum.font=[UIFont systemFontOfSize:14];
    
    _area.frame=CGRectMake(_userName.frame.origin.x, _userName.frame.origin.y+_userName.frame.size.height, 200, 20);
    _area.text=@"重点服务区域：江夏，陈田";
    _area.font=[UIFont systemFontOfSize:14];
    
    _address.frame=CGRectMake(_userName.frame.origin.x, _area.frame.origin.y+_area.frame.size.height, 200, 20);
    _address.text=@"地址：广东省广州市白云区江夏";
    _address.font=[UIFont systemFontOfSize:14];
    
    _phoneNum.frame=CGRectMake(_address.frame.origin.x, _address.frame.origin.y+_address.frame.size.height, 150, 20);
    _phoneNum.text=@"电话：15802028688";
    _phoneNum.font=[UIFont systemFontOfSize:14];
    
    _distance.frame=CGRectMake(_phoneNum.frame.origin.x+_phoneNum.frame.size.width,  _address.frame.origin.y+_address.frame.size.height, 100, 20);
    _distance.text=@"距离：1公里";
    _distance.font=[UIFont systemFontOfSize:14];

}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
